/* 出险记录  */
function getChuxianxx(url){
	$.dpAjax({
		show:true,
 		url:url,
		data:{busiId:busiId},
		success: function(datas){
		  var data = datas.result;
		  if(data) {
			  //保险年度
			 var years = data.years;
			 if(years) {
				 var html = '';
				var html = '';
				 for(var key in years) {
					 html += '<option value="'+years[key]+'">'+key+'</opton>';
				 }
 				 $('#chuxian_chuxiantabs').html(html);
			 }
			showChuxian(data);
		  }
     }
});
}

//获取出险详情
function getChuxianDetail(url){
	var compensationId = $('#chuxian_chuxiantabs').val();
	$.dpAjax({
		show:false,
 		url:url,
			data:{compensationId:compensationId},
			success: function(datas){
 			  if(datas.flag == "100100"){
				  var data = datas.result;
				  if(data) {
					  showChuxian(data);
				  }
				  return;
			   }
			  if(datas.flag == "100200"){
				  $.fn.showDatas({"datas":datas});
				  return;
              }
			 layer.msg(datas.message, {icon: 2});
         }
 	});
}


function showChuxian(data){
	 //保险
	 var dhInsuranceCompensation = data.dhInsuranceCompensation;
	 if(dhInsuranceCompensation) {
		$('#chuxian_creatorName').text(dhInsuranceCompensation.creatorName);
		$('#chuxian_created').text(formateIntegerTime(dhInsuranceCompensation.created));
		
		$('#chuxian_cardnoRemit').text(dhInsuranceCompensation.cardnoRemit);
		$('#chuxian_companyInsurance').text(dhInsuranceCompensation.companyInsurance);
		$('#chuxian_dateCompensation').text(formateDate(dhInsuranceCompensation.dateCompensation));
		$('#chuxian_dateAccept').text(formateDate(dhInsuranceCompensation.dateAccept));
		$('#chuxian_dateSend').text(formateDate(dhInsuranceCompensation.dateSend));
		
		$('#chuxian_natureCase').text(dhInsuranceCompensation.natureCaseDisplay);
		$('#chuxian_duty').text(dhInsuranceCompensation.duty);
		$('#chuxian_feeSurvey').text(showNumber(dhInsuranceCompensation.feeSurvey));
		$('#chuxian_feeRepair').text(showNumber(dhInsuranceCompensation.feeRepair));
		$('#chuxian_feeThird').text(showNumber(dhInsuranceCompensation.feeThird));
		$('#chuxian_feeOther').text(showNumber(dhInsuranceCompensation.feeOther));
		$('#chuxian_feeTotal').text(showNumber(dhInsuranceCompensation.feeTotal));
		$('#chuxian_amountIndemnity').text(showNumber(dhInsuranceCompensation.amountIndemnity));
		
		$('#chuxian_dateCacel').text(formateDate(dhInsuranceCompensation.dateCacel));
		$('#chuxian_reasonCacel').text(dhInsuranceCompensation.reasonCacel);
		$('#chuxian_dateAgain').text(formateDate(dhInsuranceCompensation.dateAgain));
		$('#chuxian_dateCalculationSheet').text(formateDate(dhInsuranceCompensation.dateCalculationSheet));
		$('#chuxian_dateRemit').text(formateDate(dhInsuranceCompensation.dateRemit));
		$('#chuxian_typeRemit').text(dhInsuranceCompensation.typeRemitDisplay);
		$('#chuxian_operatorSendback').text(dhInsuranceCompensation.operatorSendback);
		$('#chuxian_dateSendback').text(formateDate(dhInsuranceCompensation.dateSendback));
		$('#chuxian_operatorSettlement').text(dhInsuranceCompensation.operatorSettlement);
		$('#chuxian_remarks').html(dhInsuranceCompensation.remarks);
	 } else {
		 clearChuxian();
	 }
	 //车牌
	 var registrationNumber = data.registrationNumber;
	 if(registrationNumber && registrationNumber != '') {
		 $('#chuxian_registrationNumber').text(registrationNumber);
	 } else {
		 $('#chuxian_registrationNumber').text('-');
	 }
	//客户
	 var customerName = data.customerName;
	 if(customerName && customerName != '') {
		 $('#chuxian_customerName').text(customerName);
	 } else {
		 $('#chuxian_customerName').text('-');
	 }
}
function clearChuxian(){
	$('#chuxian_creatorName').text('-');
	$('#chuxian_created').text('-');
	
	$('#chuxian_cardnoRemit').text('-');
	$('#chuxian_companyInsurance').text('-');
	$('#chuxian_dateCompensation').text('-');
	$('#chuxian_dateAccept').text('-');
	$('#chuxian_dateSend').text('-');
	
	$('#chuxian_natureCase').text('-');
	$('#chuxian_duty').text('-');
	$('#chuxian_feeSurvey').text('-');
	$('#chuxian_feeRepair').text('-');
	$('#chuxian_feeThird').text('-');
	$('#chuxian_feeOther').text('-');
	$('#chuxian_feeTotal').text('-');
	$('#chuxian_amountIndemnity').text('-');
	
	$('#chuxian_dateCacel').text('-');
	$('#chuxian_reasonCacel').text('-');
	$('#chuxian_dateAgain').text('-');
	$('#chuxian_dateCalculationSheet').text('-');
	$('#chuxian_dateRemit').text('-');
	$('#chuxian_typeRemit').text('-');
	$('#chuxian_operatorSendback').text('-');
	$('#chuxian_dateSendback').text('-');
	$('#chuxian_operatorSettlement').text('-');
	$('#chuxian_remarks').html('-');
}

